/*
 * Performance Test 2
 * To test performance of the compiler.
 */

// Calculate the square root of a number `a`.
double sqrt(double a, double e)
{
	double x;
	x = a / 2.0;
	while (x * x - a > e || x * x - a < -e)
		x = (x + a / x) / 2.0;
	return x;
}

// Calculate the sum of all perfect numbers less than or equal to `n`.
int perfect_number(int n)
{
	int sum = 0, p = 1, i, s;
	while (p <= n)
	{
		i = 1;
		s = 0;
		while (i < p)
		{
			if (p % i == 0)
				s = s + i;
			i = i + 1;
		}
		if (s == p)
			sum = sum + p;
		p = p + 1;
	}
	return sum;
}

int main()
{
	double a, e;
	int n;
	a = get_double();	// get a double number `a`
	e = get_double();	// get a double number `e` as the precision
	n = get_int();		// get an integer number `n` as the upper bound
	print_double(sqrt(a, e));
	print_int(perfect_number(n));
	return 0;
}